<?php

namespace App\Repositories\Criteria\Common;

use App\Repositories\Contracts\CriteriaInterface;
use App\Repositories\Contracts\RepositoryInterface as Repository;
use App\Repositories\Contracts\RepositoryInterface;
use App\Repositories\Criteria\Criteria;

class Status extends Criteria
{
    /**
     * @var
     */
    protected $status;

    /**
     * Status constructor.
     * @param $status
     */
    public function __construct($status)
    {
        $this->status = $status;
    }

    /**
     * @param $model
     * @param RepositoryInterface $repository
     * @return mixed
     */
    public function apply($model, Repository $repository)
    {
       return $model->where('status', '=', $this->status);
    }

}